<?php
/**
 * admincp.php
 */
date_default_timezone_set('UTC');
defined('YII_DEBUG') or define('YII_DEBUG', TRUE);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

// On dev display all errors
if(YII_DEBUG) {
	error_reporting(-1);
	//ini_set('display_errors', true);
}else{
	error_reporting(0);
}

//date_default_timezone_set('UTC');

//chdir(dirname(__FILE__).'/../..');


//constant and define
$define = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR . 'define.php';

require_once($define);

$common= ROOT .'/common';
require_once($common.'/lib/framework/yii.php');
require_once($common.'/components/WebApplication.php');
require_once($common.'/lib/global.php');

$config=require(ROOT.'/backend/protected/config/main.php');


$app = Yii::createApplication('WebApplication', $config);

/* please, uncomment the following if you are using ZF library */
/*
Yii::import('common.extensions.EZendAutoloader', true);

EZendAutoloader::$prefixes = array('Zend');
EZendAutoloader::$basePath = Yii::getPathOfAlias('common.lib') . DIRECTORY_SEPARATOR;

Yii::registerAutoloader(array("EZendAutoloader", "loadClass"), true);
*/

$app->run();

/* uncomment if you wish to debug your resulting config */
/* echo '<pre>' . dump($config) . '</pre>'; */